package com.zerone.dy.demomsg.config;

import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.druid.DruidPlugin;
import com.jfinal.template.source.ClassPathSourceFactory;
import com.zerone.dy.demomsg.entity.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JFinalConfig {


//    @Bean
//    public ActiveRecordPlugin createrActiveRecordPlugin(){
//        DruidPlugin dp = new DruidPlugin("jdbc:mysql://127.0.0.1:59452/jb_auth?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true", "root", "Gz01TenMysql@202011");
//        ActiveRecordPlugin arp = new ActiveRecordPlugin(dp);
//        arp.addMapping("user_info","acNo", UserInfo.class);
//        arp.setShowSql(true);
//        arp.getEngine().setSourceFactory(new ClassPathSourceFactory());
//        // 与 jfinal web 环境唯一的不同是要手动调用一次相关插件的start()方法
//        dp.start();
//        arp.start();
//        return arp;
//    }
}
